home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).zip / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).adf / ak_gen0-lib_V38.20.LHA / ak_gen0-library / Programmers.LHA / Programmers / Examples / FileReqMode.c < prev    next >
C/C++ Source or Header  |  1993-06-27  |  2KB  |  57 lines

  1.  
  2.  /* FileReqMode V37.96                                         */
  3.  /* FREEWARE.                                                  */
  4.  /* (c) 1993 by Andreas R. Kleinert.                           */
  5.  /* Demonstrates how to switch the Library between :           */
  6.  /*  - "mixed mode"   (depending on OS, which FileRequester).  */
  7.  /*  - "asl   mode"   (try to use "asl.library", first).       */
  8.  /*  - "akreq mode"   (always use internal FileRequester).     */
  9.  /* Written in SAS/C V6.00 for OS V2.04 (V37) Includes.        */
  10.  
  11. #include <ak_gen0/ak_gen0_base.h>
  12. #include <ak_gen0/ak_gen0_pragma.h>
  13.  
  14. #include <stdlib.h>
  15. #include <string.h>
  16.  
  17. #include <proto/exec.h>
  18. #include <proto/intuition.h>
  19.  
  20. void main(long argc, char **argv) /* MAIN */
  21. {
  22.  IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library", 0);
  23.  
  24.   /* will always be open because of version==0 */
  25.  
  26.  printf("\nFileReqMode V37.96, FREEWARE, (c) 1993 by Andreas R. Kleinert.\n");
  27.  
  28.  AKBase = (struct AKBase *) OpenLibrary("ak_gen0.library", 37);
  29.  if(AKBase)
  30.   {
  31.    if(!stricmp(argv[1], "OWN"))
  32.     {
  33.      AKBase->ak_FileReqFlags |= AKBF_ALWAYS_OWN; /* always use own */
  34.      AKBase->ak_FileReqFlags ^= AKBF_ALWAYS_ASL;
  35.     }else
  36.     {
  37.      if(!stricmp(argv[1], "ASL"))
  38.       {
  39.        AKBase->ak_FileReqFlags |= AKBF_ALWAYS_ASL; /* always try asl first */
  40.        AKBase->ak_FileReqFlags ^= AKBF_ALWAYS_OWN;
  41.       }else
  42.       {
  43.        AKBase->ak_FileReqFlags &= ~(AKBF_ALWAYS_OWN|AKBF_ALWAYS_ASL); /* mixed mode */
  44.       }
  45.     }
  46.  
  47.    CloseLibrary((APTR) AKBase);
  48.   }else
  49.   {
  50.    printf("\n Can't open \42ak_gen0.library\42 V37+ !\n");
  51.   }
  52.  
  53.  CloseLibrary((APTR) IntuitionBase);
  54.  
  55.  exit(0);
  56. }
  57.